var firstController = function ($scope) {

    $scope.name = "张三";

    $scope.count = 0;

    $scope.date = {
      name : "李四",
      count: 29
    };

    //监听一个model，当一个model内次改变时，都会触发第2个函数
    $scope.$watch('name',function (newValue,oldValue) {

        ++$scope.count;

        if($scope.count>30){
            $scope.name = 'count已经大于30';
        }
    })

    $scope.$watch('data',function (newValue,oldValue) {
    },true)
//    true：data对象的属性也被监听
//    false：data对象的属性不被监听
}
